const express = require('express');

const app = express();

app.get('/user', function(req, res) {
    res.send({ name: '张三', age: 10, gender: '男' });
});

app.post('/user', function(req, res) {
    res.send({ name: '李四', age: 10, gender: '男' });
});

app.get('/', (req, res) => {
    res.send(req.query);
})

app.get('/user/:id', (req, res) => {
    console.log(req.params);
    res.send(req.params);
})

app.listen(80, function() {
    console.log('express is running at http://127.0.0.1');
})